#include <iostream>
#include <unistd.h>
#include <string.h>
#include "ShareMemory.hpp"
#include "Time.hpp"
#include "Fifo.hpp"

int main()
{
    std::cout << "Time:" << GetCurrTime << std::endl;
    std::cout << "self pid:" << getpid() << std::endl;
    shm.CreatShm();
    shm.AttachShm();

    shm.ShmMeta();

    //gpipe.OpenForRead();
    //sleep(10);
    // 在这里进行进程间通信
    // 从共享内存中获取数据并强转为struct data类型的数据
    //struct data *image = (struct data *)shm.GetAddr();
    //while (true)
    //{
    //    gpipe.Wait();
    //
    //    printf("status: %s\n", image->status);
    //    printf("lasttime: %s\n", image->lasttime);
    //    printf("image: %s\n", image->image);
    //    strcpy(image->status, "过期");
    //}
    //sleep(10);
    shm.DetachShm();
    shm.DeleteShm();
    return 0;
}